//package com.yfqy.admin.filter;
//
//import jakarta.servlet.Filter;
//import jakarta.servlet.FilterChain;
//import jakarta.servlet.ServletException;
//import jakarta.servlet.ServletRequest;
//import jakarta.servlet.ServletResponse;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.io.IOException;
//
//@Configuration
//public class GlobalRequestFilter {
//
//    private static final Logger log = LoggerFactory.getLogger(GlobalRequestFilter.class);
//
//    @Bean
//    public FilterRegistrationBean<HttpRequestParamFilter> registrationAllFilter() {
//        FilterRegistrationBean<HttpRequestParamFilter> registration = new FilterRegistrationBean<>();
//        registration.addUrlPatterns("/*");
//        registration.setFilter(new HttpRequestParamFilter());
//        registration.setName("X-HttpRequestParamFilter");
//        registration.setOrder(100);
//        return registration;
//    }
//
//    private static class HttpRequestParamFilter implements Filter {
//        @Override
//        public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
////            log.info("==================GlobalRequestFilter==================");
////            HttpServletRequest request = (HttpServletRequest) servletRequest;
////            HttpServletResponse response = (HttpServletResponse) servletResponse;
////            Tracer tracer = beanFactory.getBean(Tracer.class);
////            String traceIdString = tracer.currentSpan().context().traceIdString();
////            response.setHeader("X-B3-TraceId", traceIdString);
//            filterChain.doFilter(servletRequest, servletResponse);
//        }
//
//    }
//
//}
